<layout name='../Layout/frame_main' />

<body>
	<style type="text/css">
	.cn_val {color:blue;font-size: 16px;}
	.cn_name {font-family: "Helvetica Neue",Helvetica,Arial,"Microsoft Yahei UI","Microsoft YaHei",SimHei,"宋体",simsun,sans-serif;font-size: 16px;display:-moz-inline-box;display:inline-block;
width:70px; }
	</style>
<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<div class="page-header">
				<h2>
					订单详情
					<small>共{$count}条数据</small>
				</h2>
			</div>
			<?php 
			if(count($list)==0)
			{
				echo '<h4>暂时没有数据</h4>';
			}
			else
			{
			?>
			<table class="table table-bordered table-hover table-condensed">
				<thead>
					<tr>
						<th>
							编号
						</th>
						<th>
							产品
						</th>
						<th>
							单价/数量/总额
						</th>
						<th>
							客户姓名
						</th>						
						<th>
							手机号
						</th>
						<th>
							地址
						</th>
						<th>
							下单时间
						</th>
						<th>
							送货时间
						</th>
						<th>
							状态
						</th>
						<th>
							查看
						</th>
						<th>
							删除
						</th>												
					</tr>
				</thead>
				<tbody>

					<volist name="list" id="vo">
					<tr >
						<td>
							{$vo.order_id}
						</td>
						<td>
							{$vo.pro_name}
						</td>
						<td>
							{$vo.pro_selprice}/{$vo.order_shuliang}/<?php 
							echo intval($vo["order_shuliang"])
							*intval($vo["pro_selprice"]) 
							;?>
						</td>
						<td>
							{$vo.cus_name}
						</td>
						<td>
							{$vo.cus_phone}
						</td>
						<td>
							{$vo.cus_address}
						</td>
						<td>
							{$vo.order_time}
						</td>
						<td>
							{$vo.cus_send_date}
						</td>
						<td>
						<label class="checkbox">
							<if condition="($vo.order_status eq 0)"> 
								<input type='checkbox' /><span>未审核</span>
							<else />
								<input type="checkbox" checked /><span>已审核</span>
							</if>
						</label>
						</td>				
						<td>
						<a data-toggle="modal" class="btn btn-primary see" href="#myModalSee{$vo.order_id}" type='button'>查看</a>
						</td>
						<td>
						<a data-toggle="modal" class="btn btn-danger" href="#myModal{$vo.order_id}">删除</a>
						</td>
							<form id="form{$vo.order_id}" action="__URL__/del/order_id/{$vo.order_id}" method='get'>
							  <div id="myModal{$vo.order_id}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
							    <div class="modal-header">
							      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							      <h3 id="myModalLabel">系统确认</h3>
							    </div>
							    <div class="modal-body">
							      <p>确定要删除编号为【{$vo.order_id}】，商品名称为【{$vo.pro_name}】 的订单吗？数据删除将导致无法恢复！点击【关闭】退出继续操作，点击【确认删除】进行删除数据操作。</p>
							    </div>
							    <div class="modal-footer">
							      <button class="btn" data-dismiss="modal" aria-hidden="true" id="clbtn{$vo.order_id}">关闭</button>
							      <button class="btn btn-danger" type="submit">确认删除</button>
							    </div>
							  </div>
							</form>
							  <div id="myModalSee{$vo.order_id}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
							    <div class="modal-header">
							      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							      <h3 id="myModalLabel">订单详情</h3>
							    </div>
							    <div class="modal-body">
<div class="container-fluid">
	<div class="row-fluid">
		<div class="span6">

			<span class='cn_name'>编号 </span>:
			<span class='cn_val'>{$vo.order_id} </span><br/>
			<span class='cn_name'>订单时间 </span>:
			<span class='cn_val'>{$vo.order_time} </span><br/>
			<span class='cn_name'>状态 </span>:
			<span class='cn_val'><if condition="($vo.order_status eq 0)"> 
								未审核
							<else />
								已审核
							</if> </span><br/>
			<span class='cn_name'>数量 </span>:
			<span class='cn_val'>{$vo.order_shuliang} </span><br/>
			<span class='cn_name'>客户名称 </span>:
			<span class='cn_val'>{$vo.cus_name} </span><br/>
			<span class='cn_name'>手机 </span>:
			<span class='cn_val'>{$vo.cus_phone} </span><br/>
			<span class='cn_name'>学校 </span>:
			<span class='cn_val'>{$vo.cus_school} </span><br/>
			<span class='cn_name'>送货时间 </span>:
			<span class='cn_val'>{$vo.cus_send_date} </span><br/>
			<span class='cn_name'>地址 </span>:
			<span class='cn_val'>{$vo.cus_address} </span><br/>
			<span class='cn_name'>产品 </span>:
			<span class='cn_val'>{$vo.pro_name} </span><br/>

		</div>
		<div class="span6">
			<a href="__URL__/newp/pro_id/{$vo.pro_id}">
			<img src='__PUBLIC__/Imgs/Products/m_{$vo.pro_img}'/>
			</a>
		</div>
	</div>
</div>
							    </div>
							    <div class="modal-footer">
							      <button class="btn" data-dismiss="modal" aria-hidden="true" id="clbtn{$vo.order_id}">关闭</button>
							    </div>
							  </div>
							</tr>
				</volist>
				
				</tbody>
			</table>

			<div class="pagination pagination-centered">
				<ul>
					<li>{$page}</li>
				</ul>
			</div>
			<?php } ?>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
		</div>
	</div>
</div>
</body>
<script type="text/javascript">
	$('input:checkbox').click(function(){
		var v=$.trim($(this).parent().parent().parent().children(':first').text());
		var tc=this;
		$.post(
			"__URL__/check/",
			'value='+v+'&data='+(this.checked?1:0),
			function(data){
				if(data=='OK')
				{
					$(tc).next().text(tc.checked?'已审核':'未审核');
					alert('处理成功！');
					<?php if(isset($_GET['order_status'])) echo 'location.reload();'; ?>
				}
				else
				{
					alert('处理失败！');
					tc.checked=!tc.checked;
				}
			});
	});
</script>